#ifndef PROPEDITDIALOG_H
#define PROPEDITDIALOG_H

#include <QDialog>
#include "propdata.h"

namespace Ui {
    class PropEditDialog;
}

class PropEditDialog : public QDialog
{
    Q_OBJECT

public:
    enum MediaType { AUDIO = 1001, VIDEO = 1002, PICTURE = 1003 };

    explicit PropEditDialog(QWidget *parent = 0, PropData *propToEdit = 0);
    ~PropEditDialog();

signals:
    void newPropInfo(PropData *prop);
    void deleteProp(QString pName);

private slots:
    void on_audioAddPushButton_clicked();

    void on_mainAudioPushButton_clicked();

    void accept();

    bool on_propNameLineEdit_lostFocus();

    void on_videoAddPushButton_clicked();

    void on_picAddPushButton_clicked();

    void on_mediaRemovePushButton_clicked();

    void on_mediaListWidget_itemSelectionChanged();

    void on_removeMainAudToolButton_clicked();

    void on_scriptEditToolButton_clicked();

    void mainAudScriptUpdate(QString text);

    void on_coordSelPushButton_clicked();

    void setNewLatLon(double lat, double lon);

private:
    Ui::PropEditDialog *ui;

    PropData *prop;
    PropData *oldProp;
    QString editPropName;
    QAction *remMedia;

    void addMediaToList(QStringList fnames, MediaType type);
    void saveOldProp(PropData *prop);
};

#endif // PROPEDITDIALOG_H
